#include "view_power_off.h"
#include "app_trace.h"
#include "battery_ctrl.h"
#include "blecom.h"
#include "datetime.h"
#include "display_ctrl.h"
#include "display_interface.h"
#include "font_mngr.h"
#include "heart_rate_interface.h"
#include "lfs_file_manager_auto.h"
#include "math.h"
#include "platform_assert.h"
#include "rtc.h"
#include "sport_his.h"
#include "weather_ctrl.h"
#include "Motor.h"
#include "common/common.h"
#include "font/font.h"
#include "view_power_off.inc"

void view_power_off_display(int view)
{
    draw_on_chip_gradients_image(6, 46, zip_image_circle, 0xff4c, 0xfc27);
    draw_on_chip_gray_image_filter_color(6, 46, zip_image_power_off, RGB565_COLOR_WHITE);
}
view_event_result_t view_power_off_event(int view, event_param_t const *param)
{
    switch (param->event)
    {
#ifdef EVENT_LEVEL_DOWN
    case event_move_level_down:
#endif
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
        motor_start(500);
        system_into_poweroff();
        return view_event_result_handled;
    }
    return view_event_result_not_handled;
}
